<em>import React from 'react'</em>
<em>import { <q>Routes</q>, <q>Route</q>, } from 'react-router-dom'</em>

<em>const</em> <u>News</u> 	= <em>( ) => import('@pages/news')</em>

<em># 子路由</em>
<em>const</em> <u>ChildRouter</u> 	= <em>( ) => (
	<q>&lt;Routes&gt;</q>
		<q>&lt;Route</q> 	<b>path</b> = '<s>/my</s>' 			<b>element</b> = <i>{</i> <u>&lt;News/&gt;</u> <i>}</i> <q>/&gt;</q>
		<q>&lt;Route</q> 	<b>path</b> = '<s>my</s>' 			<b>element</b> = <i>{</i> <u>&lt;News/&gt;</u> <i>}</i> <q>/&gt;</q>
		<q>&lt;Route</q> 	<b>path</b> = '<s>/:id</s>' 			<b>element</b> = <i>{</i> <u>&lt;News/&gt;</u> <i>}</i> <q>/&gt;</q>
		<q>&lt;Route</q> 	<b>path</b> = '<s>:id</s>' 			<b>element</b> = <i>{</i> <u>&lt;News/&gt;</u> <i>}</i> <q>/&gt;</q>
	<q>&lt;/Routes&gt;</q>
)

<em>export default ( ) =></em> (
	<q>&lt;Routes&gt;</q>
		<em># 嵌套路由，访问路径：'news/my'、'news/10'</em>
		<q>&lt;Route</q> 	<b>path</b> = '<s>news/*</s>' 		<b>element</b> = <i>{</i> <u>&lt;ChildRouter/&gt;</u> <i>}</i> <q>/&gt;</q>
		<q>&lt;Route</q> 	<b>path</b> = '<s>/news/*</s>' 		<b>element</b> = <i>{</i> <u>&lt;ChildRouter/&gt;</u> <i>}</i> <q>/&gt;</q>
	<q>&lt;/Routes&gt;</q>
)